package com.example.content.activity

import android.content.Intent
import android.os.Bundle
import androidx.databinding.DataBindingUtil
import com.example.content.ME_FEEDBACK_PAGE_TYPE
import com.example.content.R
import com.example.content.databinding.ActivitySettingBinding
import com.example.content.manager.ActivityMgr
import com.example.content.viewmodule.login.TokenStore

class SettingActivity : BaseUIActivity() {
    private lateinit var dataBinding: ActivitySettingBinding
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        dataBinding = DataBindingUtil.setContentView(this, R.layout.activity_setting)
        initView()
    }

    private fun initView() {
        dataBinding.backIcon.setOnClickListener {
            finish()
        }
        dataBinding.logout.setOnClickListener {
            TokenStore.logout()
            startActivity(Intent(this, LoginActivity::class.java))
            ActivityMgr.finishAll()
        }
        dataBinding.feedback.setOnClickListener {
           ActivityMgr.startFragment(ME_FEEDBACK_PAGE_TYPE)
        }
    }
}